home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-02-02 | 47.9 KB | 1,655 lines |
- ===================================================================
- RCS file: /net/acae127/home/bammi/etc/src/master/atari/libg++/Changelo,v
- retrieving revision 1.1.1.1
- diff -c -r1.1.1.1 Changelo
- *** 1.1.1.1 1993/11/27 22:01:07
- --- Changelo 1994/02/01 23:07:42
- ***************
- *** 339,341 ****
- --- 339,368 ----
- becoming a major pain in the butt.:: ++jrb
-
- ---------------------------- Patchlevel 21 -----------------------------------
- + in iosrc: builtinbuf.cc filedoalloc.c fileops.c floatconv.c genops.c
- + iofclose.c iofdopen.c iofopen.c iofputs.c iofread.c iofwrite.c
- + iopopen.c iostream.cc iovfscanf.c pfstream.cc sbscan.cc stdfiles.c
- + stdstreams.cc streambuf.cc strops.c strstream.cc :: ++jrb
- +
- + sync with libg++ 2.5.2
- +
- + in iotests: tiomisc.cc tiomisc.exp: ++jrb
- + new test from libg++ 2.5.2
- +
- + iotests/makefile.32, iotests/run32.g: ++jrb
- + add above test
- +
- + in g++-inc : fstream.h iolibio.h libio.h libioP.h
- + streambuf.h strstream.h: ++jrb
- + sync with libg++ 2.5.2
- +
- + in iosrc: filedoalloc.c genops.c indstream.cc iofread.c iofsetpos.c
- + iofwrite.c iovfprintf.c iovfscanf.c iovsscanf.c sbscan.cc : ++jrb
- +
- + sync with libg++ 2.5.3
- +
- + in g++-inc: iostreamP.h libioP.h streambuf.h
- + sync with libg++ 2.5.3
- +
- + in libsrc: xfix.cc xinteger.cc: ++jrb
- + sync with libg++ 2.5.3
- ===================================================================
- RCS file: /net/acae127/home/bammi/etc/src/master/atari/libg++/include/PatchLev.h,v
- retrieving revision 1.1.1.1
- diff -c -r1.1.1.1 PatchLev.h
- *** 1.1.1.1 1993/11/27 22:01:08
- --- PatchLev.h 1993/12/07 22:52:13
- ***************
- *** 1,5 ****
-
- ! #define PatchLevel "21"
-
- /*
- * the Patch Level above is to identify the version
- --- 1,5 ----
-
- ! #define PatchLevel "22"
-
- /*
- * the Patch Level above is to identify the version
- ===================================================================
- RCS file: /net/acae127/home/bammi/etc/src/master/atari/libg++/include/fstream.h,v
- retrieving revision 1.1.1.1
- diff -c -r1.1.1.1 fstream.h
- *** 1.1.1.1 1993/11/27 22:01:14
- --- fstream.h 1993/12/07 22:10:47
- ***************
- *** 36,42 ****
- fstreambase(int fd, char *p, int l); /* Deprecated */
- fstreambase(const char *name, int mode, int prot=0664);
- void close();
- ! filebuf* rdbuf() const { return (filebuf*)_strbuf; }
- void open(const char *name, int mode, int prot=0664);
- int is_open() const { return rdbuf()->is_open(); }
- void setbuf(char *ptr, int len) { rdbuf()->setbuf(ptr, len); }
- --- 36,42 ----
- fstreambase(int fd, char *p, int l); /* Deprecated */
- fstreambase(const char *name, int mode, int prot=0664);
- void close();
- ! filebuf* rdbuf() const { return (filebuf*) ios::rdbuf(); }
- void open(const char *name, int mode, int prot=0664);
- int is_open() const { return rdbuf()->is_open(); }
- void setbuf(char *ptr, int len) { rdbuf()->setbuf(ptr, len); }
- ===================================================================
- RCS file: /net/acae127/home/bammi/etc/src/master/atari/libg++/include/iolibio.h,v
- retrieving revision 1.1.1.1
- diff -c -r1.1.1.1 iolibio.h
- *** 1.1.1.1 1993/11/27 22:01:15
- --- iolibio.h 1993/12/07 22:11:20
- ***************
- *** 13,19 ****
- extern int _IO_fputs _PARAMS((const char*, _IO_FILE*));
- extern int _IO_fsetpos _PARAMS((_IO_FILE*, const _IO_fpos_t *));
- extern long int _IO_ftell _PARAMS((_IO_FILE*));
- ! extern _IO_size_t _IO_fwrite _PARAMS((const char*,
- _IO_size_t, _IO_size_t, _IO_FILE*));
- extern char* _IO_gets _PARAMS((char*));
- extern void _IO_perror _PARAMS((const char*));
- --- 13,19 ----
- extern int _IO_fputs _PARAMS((const char*, _IO_FILE*));
- extern int _IO_fsetpos _PARAMS((_IO_FILE*, const _IO_fpos_t *));
- extern long int _IO_ftell _PARAMS((_IO_FILE*));
- ! extern _IO_size_t _IO_fwrite _PARAMS((const void*,
- _IO_size_t, _IO_size_t, _IO_FILE*));
- extern char* _IO_gets _PARAMS((char*));
- extern void _IO_perror _PARAMS((const char*));
- ***************
- *** 29,35 ****
- #ifndef _IO_pos_BAD
- #define _IO_pos_BAD ((_IO_fpos_t)(-1))
- #endif
- ! #define _IO_clearerr(FP) ((FP)_flags &= ~(_IO_ERR_SEEN|_IO_EOF_SEEN))
- #define _IO_feof(__fp) (((__fp)->_flags & _IO_EOF_SEEN) != 0)
- #define _IO_ferror(__fp) (((__fp)->_flags & _IO_ERR_SEEN) != 0)
- #define _IO_fseek(__fp, __offset, __whence) \
- --- 29,35 ----
- #ifndef _IO_pos_BAD
- #define _IO_pos_BAD ((_IO_fpos_t)(-1))
- #endif
- ! #define _IO_clearerr(FP) ((FP)->_flags &= ~(_IO_ERR_SEEN|_IO_EOF_SEEN))
- #define _IO_feof(__fp) (((__fp)->_flags & _IO_EOF_SEEN) != 0)
- #define _IO_ferror(__fp) (((__fp)->_flags & _IO_ERR_SEEN) != 0)
- #define _IO_fseek(__fp, __offset, __whence) \
- ===================================================================
- RCS file: /net/acae127/home/bammi/etc/src/master/atari/libg++/include/iostreamP.h,v
- retrieving revision 1.1.1.1
- diff -c -r1.1.1.1 iostreamP.h
- *** 1.1.1.1 1993/11/27 22:01:15
- --- iostreamP.h 1994/02/01 22:32:17
- ***************
- *** 29,34 ****
- convert_to_seekflags(int dir, int mode)
- {
- return (_IO_seekflags)((int)dir
- ! | (mode & ios::in ? 0 : _IO_seek_not_in)
- ! | (mode & ios::out ? 0 : _IO_seek_not_out));
- }
- --- 29,34 ----
- convert_to_seekflags(int dir, int mode)
- {
- return (_IO_seekflags)((int)dir
- ! | (mode & ios::in ? _IO_seek_set : _IO_seek_not_in)
- ! | (mode & ios::out ? _IO_seek_set : _IO_seek_not_out));
- }
- ===================================================================
- RCS file: /net/acae127/home/bammi/etc/src/master/atari/libg++/include/libio.h,v
- retrieving revision 1.1.1.1
- diff -c -r1.1.1.1 libio.h
- *** 1.1.1.1 1993/11/27 22:01:15
- --- libio.h 1993/12/07 22:11:32
- ***************
- *** 140,145 ****
- --- 140,147 ----
-
- /* A streammarker remembers a position in a buffer. */
-
- + struct _IO_jump_t; struct _IO_FILE;
- +
- struct _IO_marker {
- struct _IO_marker *_next;
- struct _IO_FILE *_sbuf;
- ***************
- *** 159,166 ****
- #endif
- };
-
- - struct _IO_jump_t;
- -
- struct _IO_FILE {
- int _flags; /* High-order word is _IO_MAGIC; rest is flags. */
- #define _IO_file_flags _flags
- --- 161,166 ----
- ===================================================================
- RCS file: /net/acae127/home/bammi/etc/src/master/atari/libg++/include/libioP.h,v
- retrieving revision 1.1.1.1
- diff -c -r1.1.1.1 libioP.h
- *** 1.1.1.1 1993/11/27 22:01:15
- --- libioP.h 1994/02/01 22:32:35
- ***************
- *** 42,48 ****
- read and write positions. */
- _IO_seek_not_in = 4, /* Don't move read posistion. */
- _IO_seek_not_out = 8, /* Don't move write posistion. */
- ! _IO_seek_pos_ignored = 16, /* Result is ignored (except EOF) */
- } _IO_seekflags;
-
- typedef int (*_IO_overflow_t) _PARAMS((_IO_FILE*, int));
- --- 42,48 ----
- read and write positions. */
- _IO_seek_not_in = 4, /* Don't move read posistion. */
- _IO_seek_not_out = 8, /* Don't move write posistion. */
- ! _IO_seek_pos_ignored = 16 /* Result is ignored (except EOF) */
- } _IO_seekflags;
-
- typedef int (*_IO_overflow_t) _PARAMS((_IO_FILE*, int));
- ***************
- *** 114,119 ****
- --- 114,120 ----
-
- /* Default jumptable functions. */
-
- + extern int _IO_default_underflow _PARAMS((_IO_FILE*));
- extern int _IO_default_doallocate _PARAMS((_IO_FILE*));
- extern void _IO_default_finish _PARAMS((_IO_FILE *));
- extern int _IO_default_pbackfail _PARAMS((_IO_FILE*, int));
- ***************
- *** 126,133 ****
- extern _IO_ssize_t _IO_default_read _PARAMS((_IO_FILE*, void*, _IO_ssize_t));
- extern int _IO_default_stat _PARAMS((_IO_FILE*, void*));
- extern _IO_fpos_t _IO_default_seek _PARAMS((_IO_FILE*, _IO_off_t, int));
- ! #define _IO_default_sync (_IO_sync_t)0
- ! #define _IO_default_close (_IO_close_t)0
-
- extern struct _IO_jump_t _IO_file_jumps;
- extern struct _IO_jump_t _IO_proc_jumps;
- --- 127,134 ----
- extern _IO_ssize_t _IO_default_read _PARAMS((_IO_FILE*, void*, _IO_ssize_t));
- extern int _IO_default_stat _PARAMS((_IO_FILE*, void*));
- extern _IO_fpos_t _IO_default_seek _PARAMS((_IO_FILE*, _IO_off_t, int));
- ! extern int _IO_default_sync _PARAMS((_IO_FILE*));
- ! #define _IO_default_close ((_IO_close_t)_IO_default_sync)
-
- extern struct _IO_jump_t _IO_file_jumps;
- extern struct _IO_jump_t _IO_proc_jumps;
- ***************
- *** 153,159 ****
- /* Jumptable functions for files. */
-
- extern int _IO_file_doallocate _PARAMS((_IO_FILE*));
- ! int _IO_file_setbuf _PARAMS((_IO_FILE *, char*, _IO_ssize_t));
- extern _IO_fpos_t _IO_file_seekoff _PARAMS((_IO_FILE*, _IO_off_t, _IO_seekflags));
- extern _IO_size_t _IO_file_xsputn _PARAMS((_IO_FILE*,const void*,_IO_size_t));
- extern int _IO_file_stat _PARAMS((_IO_FILE*, void*));
- --- 154,160 ----
- /* Jumptable functions for files. */
-
- extern int _IO_file_doallocate _PARAMS((_IO_FILE*));
- ! extern int _IO_file_setbuf _PARAMS((_IO_FILE *, char*, _IO_ssize_t));
- extern _IO_fpos_t _IO_file_seekoff _PARAMS((_IO_FILE*, _IO_off_t, _IO_seekflags));
- extern _IO_size_t _IO_file_xsputn _PARAMS((_IO_FILE*,const void*,_IO_size_t));
- extern int _IO_file_stat _PARAMS((_IO_FILE*, void*));
- ===================================================================
- RCS file: /net/acae127/home/bammi/etc/src/master/atari/libg++/include/streambuf.h,v
- retrieving revision 1.1.1.1
- diff -c -r1.1.1.1 streambuf.h
- *** 1.1.1.1 1993/11/27 22:01:16
- --- streambuf.h 1994/02/01 22:32:50
- ***************
- *** 56,61 ****
- --- 56,62 ----
- #define _IO_wchar_t short
- #endif
-
- + class istream; /* Work-around for a g++ name mangling bug. */
- class ostream; class streambuf;
-
- // In case some header files defines these as macros.
- ***************
- *** 194,200 ****
- #else
- void _throw_failure() const { }
- #endif
- ! void _IO_fix_vtable();
- streambuf* rdbuf() const;
- #if 0
- streambuf* rdbuf(streambuf *_s) {
- --- 195,202 ----
- #else
- void _throw_failure() const { }
- #endif
- ! void _IO_fix_vtable(); /* TEMPORARY - for binary compatibility */
- ! void _IO_fix_vtable() const;
- streambuf* rdbuf() const;
- #if 0
- streambuf* rdbuf(streambuf *_s) {
- ***************
- *** 402,423 ****
- // A backupbuf is a streambuf with full backup and savepoints on reading.
- // All standard streambufs in the GNU iostream library are backupbufs.
-
- - #if 0
- - // A backupbuf may have two get area:
- - // - The main get area, and (sometimes) the putback area.
- - // Whichever one of these contains the gptr is the current get area;
- - // the other one is the non-current get area.
- -
- - class backupbuf : public streambuf {
- - friend class streammarker;
- - protected:
- - backupbuf(int flags=0) : streambuf(flags|_IO_IS_BACKUPBUF) { }
- - public:
- - virtual int underflow();
- - virtual int overflow(int c = EOF);
- - };
- - #endif
- -
- class filebuf : public streambuf {
- protected:
- void init();
- --- 404,409 ----
- ***************
- *** 465,471 ****
- inline streambuf* ios::rdbuf() const
- {
- if (_strbuf && _strbuf->_vtable() == 0)
- ! ((ios*)this)->_IO_fix_vtable();
- return _strbuf;
- }
-
- --- 451,457 ----
- inline streambuf* ios::rdbuf() const
- {
- if (_strbuf && _strbuf->_vtable() == 0)
- ! _IO_fix_vtable();
- return _strbuf;
- }
-
- ===================================================================
- RCS file: /net/acae127/home/bammi/etc/src/master/atari/libg++/include/strstream.h,v
- retrieving revision 1.1.1.1
- diff -c -r1.1.1.1 strstream.h
- *** 1.1.1.1 1993/11/27 22:01:16
- --- strstream.h 1993/12/07 22:12:07
- ***************
- *** 75,81 ****
-
- class strstreambase : virtual public ios {
- public:
- ! strstreambuf* rdbuf() { return (strstreambuf*)_strbuf; }
- protected:
- strstreambase() { }
- strstreambase(char *cp, int n, int mode=ios::out);
- --- 75,81 ----
-
- class strstreambase : virtual public ios {
- public:
- ! strstreambuf* rdbuf() { return (strstreambuf*)ios::rdbuf(); }
- protected:
- strstreambase() { }
- strstreambase(char *cp, int n, int mode=ios::out);
- ===================================================================
- RCS file: /net/acae127/home/bammi/etc/src/master/atari/libg++/iosrc/builtinbuf.cc,v
- retrieving revision 1.1.1.1
- diff -c -r1.1.1.1 builtinbuf.cc
- *** 1.1.1.1 1993/11/27 22:01:22
- --- builtinbuf.cc 1993/12/07 22:10:31
- ***************
- *** 81,96 ****
- int builtinbuf::sys_close()
- { return _jumps->__close(this); }
-
- ! static const void *get_builtin_vtable()
- {
- ! char _dummy[sizeof(builtinbuf)];
- ! ((builtinbuf*)_dummy)->builtinbuf::builtinbuf();
- ! return ((builtinbuf*)_dummy)->_vtable();
- }
-
- ! const void *builtinbuf::vtable = get_builtin_vtable();
- !
- void ios::_IO_fix_vtable()
- {
- ! _strbuf->_vtable() = builtinbuf::vtable;
- }
- --- 81,102 ----
- int builtinbuf::sys_close()
- { return _jumps->__close(this); }
-
- ! const void *builtinbuf::vtable = NULL;
- !
- ! void ios::_IO_fix_vtable() const
- {
- ! if (builtinbuf::vtable == NULL)
- ! {
- ! char _dummy[sizeof(builtinbuf)];
- ! ((builtinbuf*)_dummy)->builtinbuf::builtinbuf();
- ! builtinbuf::vtable = ((builtinbuf*)_dummy)->_vtable();
- ! }
- ! /* Cast away constness. Maybe we should use the new 'mutable' keyword. */
- ! ((ios*)this)->_strbuf->_vtable() = builtinbuf::vtable;
- }
-
- ! /* This method is TEMPORARY, for binary compatibility! */
- void ios::_IO_fix_vtable()
- {
- ! ((const ios*) this)->_IO_fix_vtable();
- }
- ===================================================================
- RCS file: /net/acae127/home/bammi/etc/src/master/atari/libg++/iosrc/filedoalloc.c,v
- retrieving revision 1.2
- diff -c -r1.2 filedoalloc.c
- *** 1.2 1993/11/29 22:11:37
- --- filedoalloc.c 1994/02/01 22:34:16
- ***************
- *** 41,46 ****
- --- 41,47 ----
-
- /* Modified for GNU iostream by Per Bothner 1991, 1992. */
-
- + #define _POSIX_SOURCE
- #include "libioP.h"
- #include <sys/types.h>
- #include <sys/stat.h>
- ***************
- *** 63,69 ****
- _IO_file_doallocate(fp)
- register _IO_FILE *fp;
- {
- ! register size_t size, couldbetty;
- register char *p;
- struct stat st;
-
- --- 64,71 ----
- _IO_file_doallocate(fp)
- register _IO_FILE *fp;
- {
- ! register _IO_size_t size;
- ! int couldbetty;
- register char *p;
- struct stat st;
-
- ===================================================================
- RCS file: /net/acae127/home/bammi/etc/src/master/atari/libg++/iosrc/fileops.c,v
- retrieving revision 1.1.1.1
- diff -c -r1.1.1.1 fileops.c
- *** 1.1.1.1 1993/11/27 22:01:23
- --- fileops.c 1993/12/07 22:10:32
- ***************
- *** 24,34 ****
-
- /* written by Per Bothner (bothner@cygnus.com) */
-
- #include "libioP.h"
- #include <fcntl.h>
- - #include <errno.h>
- #include <sys/types.h>
- #include <sys/stat.h>
- #ifndef errno
- extern int errno;
- #endif
- --- 24,36 ----
-
- /* written by Per Bothner (bothner@cygnus.com) */
-
- + #define _POSIX_SOURCE
- #include "libioP.h"
- #include <fcntl.h>
- #include <sys/types.h>
- #include <sys/stat.h>
- + #include <string.h>
- + #include <errno.h>
- #ifndef errno
- extern int errno;
- #endif
- ***************
- *** 127,133 ****
- {
- if (!(fp->_flags & _IO_DELETE_DONT_CLOSE))
- _IO_file_close_it(fp);
- - _IO_un_link(fp);
- _IO_default_finish(fp);
- }
-
- --- 129,134 ----
- ===================================================================
- RCS file: /net/acae127/home/bammi/etc/src/master/atari/libg++/iosrc/floatconv.c,v
- retrieving revision 1.2
- diff -c -r1.2 floatconv.c
- *** 1.2 1993/11/29 22:11:41
- --- floatconv.c 1993/12/07 22:14:34
- ***************
- *** 125,130 ****
- --- 125,131 ----
- /* In this case, we assume IEEE floats. */
- #define FLT_ROUNDS 1
- #define FLT_RADIX 2
- + #define DBL_MANT_DIG 53
- #define DBL_DIG 15
- #define DBL_MAX_10_EXP 308
- #define DBL_MAX_EXP 1024
- ***************
- *** 141,150 ****
- #define Sign_Extend(a,b) /*no-op*/
- #endif
-
- ! #if defined(__i386__) || defined(clipper) || defined(MIPSEL)
- #define IEEE_8087
- #endif
- !
- #if defined(__sparc__) || defined(sparc) || defined(MIPSEB) || defined(atarist)
- #define IEEE_MC68k
- #endif
- --- 142,153 ----
- #define Sign_Extend(a,b) /*no-op*/
- #endif
-
- ! #if defined(__i386__) || defined(__i860__) || defined(clipper)
- #define IEEE_8087
- #endif
- ! #if defined(MIPSEL) || defined(__alpha__)
- ! #define IEEE_8087
- ! #endif
- #if defined(__sparc__) || defined(sparc) || defined(MIPSEB) || defined(atarist)
- #define IEEE_MC68k
- #endif
- ***************
- *** 347,353 ****
-
- /* Initialize a stack-allocated Bigint. */
-
- ! Bigint *
- Binit
- #ifdef KR_headers
- (v) Bigint *v;
- --- 350,356 ----
-
- /* Initialize a stack-allocated Bigint. */
-
- ! static Bigint *
- Binit
- #ifdef KR_headers
- (v) Bigint *v;
- ***************
- *** 1108,1113 ****
- --- 1111,1117 ----
- goto break2;
- /* no break */
- case 0:
- + s = s00;
- goto ret;
- case '\t':
- case '\n':
- ===================================================================
- RCS file: /net/acae127/home/bammi/etc/src/master/atari/libg++/iosrc/genops.c,v
- retrieving revision 1.1.1.1
- diff -c -r1.1.1.1 genops.c
- *** 1.1.1.1 1993/11/27 22:01:23
- --- genops.c 1994/02/01 22:32:03
- ***************
- *** 25,30 ****
- --- 25,32 ----
- /* Generic or default I/O operations. */
-
- #include "libioP.h"
- + #include <stdlib.h>
- + #include <string.h>
-
- void _IO_un_link(fp)
- _IO_FILE *fp;
- ***************
- *** 262,267 ****
- --- 264,276 ----
- _IO_setb(fp, fp->_shortbuf, fp->_shortbuf+1, 0);
- }
-
- + int
- + _IO_default_underflow (fp)
- + _IO_FILE *fp;
- + {
- + return EOF;
- + }
- +
- _IO_size_t
- _IO_default_xsputn(f, data, n)
- register _IO_FILE *f;
- ***************
- *** 426,431 ****
- --- 435,447 ----
- fp->_cur_column = 0;
- }
-
- + int
- + _IO_default_sync (fp)
- + _IO_FILE *fp;
- + {
- + return 0;
- + }
- +
- void _IO_default_finish (fp)
- _IO_FILE *fp;
- {
- ***************
- *** 627,632 ****
- --- 643,649 ----
- _IO_switch_to_backup_area(fp);
- fp->_IO_read_ptr = fp->_IO_read_end + mark->_pos;
- }
- + return 0;
- }
-
- void _IO_unsave_markers(fp)
- ===================================================================
- RCS file: /net/acae127/home/bammi/etc/src/master/atari/libg++/iosrc/indstream.cc,v
- retrieving revision 1.1.1.1
- diff -c -r1.1.1.1 indstream.cc
- *** 1.1.1.1 1993/11/27 22:01:23
- --- indstream.cc 1994/02/01 22:32:03
- ***************
- *** 103,114 ****
-
- int indirectbuf::sync()
- {
- ! streambuf *gbuf = get_stream();
- ! int ret_val = gbuf->sync();
- ! if (ret_val == EOF) return ret_val;
- ! streambuf *pbuf = put_stream();
- ! if (pbuf != gbuf) return pbuf->sync();
- ! else return ret_val;
- }
-
- int indirectbuf::pbackfail(int c)
- --- 103,113 ----
-
- int indirectbuf::sync()
- {
- ! streambuf *gbuf = get_stream();
- ! int get_ret_val = gbuf ? gbuf->sync() : 0;
- ! streambuf *pbuf = put_stream();
- ! int put_ret_val = (pbuf && pbuf != gbuf) ? pbuf->sync() : 0;
- ! return get_ret_val || put_ret_val;
- }
-
- int indirectbuf::pbackfail(int c)
- ===================================================================
- RCS file: /net/acae127/home/bammi/etc/src/master/atari/libg++/iosrc/iofclose.c,v
- retrieving revision 1.1.1.1
- diff -c -r1.1.1.1 iofclose.c
- *** 1.1.1.1 1993/11/27 22:01:24
- --- iofclose.c 1993/12/07 22:11:06
- ***************
- *** 23,28 ****
- --- 23,29 ----
- the executable file might be covered by the GNU General Public License. */
-
- #include "libioP.h"
- + #include <stdlib.h>
-
- int
- _IO_fclose(fp)
- ***************
- *** 30,37 ****
- {
- int status = 0;
- COERCE_FILE(fp);
- ! status = fp->_jumps->__close(fp);
- fp->_jumps->__finish(fp);
- ! free(fp);
- return status;
- }
- --- 31,40 ----
- {
- int status = 0;
- COERCE_FILE(fp);
- ! if (fp->_IO_file_flags & _IO_IS_FILEBUF)
- ! status = _IO_file_close_it(fp);
- fp->_jumps->__finish(fp);
- ! if (fp != _IO_stdin && fp != _IO_stdout && fp != _IO_stderr)
- ! free(fp);
- return status;
- }
- ===================================================================
- RCS file: /net/acae127/home/bammi/etc/src/master/atari/libg++/iosrc/iofdopen.c,v
- retrieving revision 1.1.1.1
- diff -c -r1.1.1.1 iofdopen.c
- *** 1.1.1.1 1993/11/27 22:01:24
- --- iofdopen.c 1993/12/07 22:11:07
- ***************
- *** 53,63 ****
- read_write &= _IO_IS_APPENDING;
-
- fp = (struct _IO_FILE_plus*)malloc(sizeof(struct _IO_FILE_plus));
- _IO_init(&fp->_file, 0);
- fp->_file._jumps = &_IO_file_jumps;
- _IO_file_init(&fp->_file);
- - if (fp == NULL)
- - return NULL;
- fp->_vtable = NULL;
- if (_IO_file_attach(&fp->_file, fd) == NULL)
- {
- --- 53,63 ----
- read_write &= _IO_IS_APPENDING;
-
- fp = (struct _IO_FILE_plus*)malloc(sizeof(struct _IO_FILE_plus));
- + if (fp == NULL)
- + return NULL;
- _IO_init(&fp->_file, 0);
- fp->_file._jumps = &_IO_file_jumps;
- _IO_file_init(&fp->_file);
- fp->_vtable = NULL;
- if (_IO_file_attach(&fp->_file, fd) == NULL)
- {
- ===================================================================
- RCS file: /net/acae127/home/bammi/etc/src/master/atari/libg++/iosrc/iofopen.c,v
- retrieving revision 1.1.1.1
- diff -c -r1.1.1.1 iofopen.c
- *** 1.1.1.1 1993/11/27 22:01:24
- --- iofopen.c 1993/12/07 22:11:07
- ***************
- *** 23,28 ****
- --- 23,29 ----
- the executable file might be covered by the GNU General Public License. */
-
- #include "libioP.h"
- + #include <stdlib.h>
-
- _IO_FILE *
- _IO_fopen (filename, mode)
- ***************
- *** 31,36 ****
- --- 32,39 ----
- {
- struct _IO_FILE_plus *fp =
- (struct _IO_FILE_plus*)malloc(sizeof(struct _IO_FILE_plus));
- + if (fp == NULL)
- + return NULL;
- _IO_init(&fp->_file, 0);
- fp->_file._jumps = &_IO_file_jumps;
- _IO_file_init(&fp->_file);
- ===================================================================
- RCS file: /net/acae127/home/bammi/etc/src/master/atari/libg++/iosrc/iofputs.c,v
- retrieving revision 1.1.1.1
- diff -c -r1.1.1.1 iofputs.c
- *** 1.1.1.1 1993/11/27 22:01:24
- --- iofputs.c 1993/12/07 22:11:07
- ***************
- *** 23,28 ****
- --- 23,29 ----
- the executable file might be covered by the GNU General Public License. */
-
- #include "libioP.h"
- + #include <string.h>
-
- int _IO_fputs(str, fp)
- const char *str;
- ===================================================================
- RCS file: /net/acae127/home/bammi/etc/src/master/atari/libg++/iosrc/iofread.c,v
- retrieving revision 1.1.1.1
- diff -c -r1.1.1.1 iofread.c
- *** 1.1.1.1 1993/11/27 22:01:25
- --- iofread.c 1994/02/01 22:32:03
- ***************
- *** 34,39 ****
- _IO_size_t bytes_requested = size*count;
- _IO_size_t bytes_read;
- COERCE_FILE(fp);
- ! bytes_read = fp->_jumps->__xsgetn(fp, (char *)buf, bytes_requested);
- return bytes_requested == bytes_read ? count : bytes_read / size;
- }
- --- 34,41 ----
- _IO_size_t bytes_requested = size*count;
- _IO_size_t bytes_read;
- COERCE_FILE(fp);
- ! if (bytes_requested == 0)
- ! return 0;
- ! bytes_read = _IO_sgetn(fp, (char *)buf, bytes_requested);
- return bytes_requested == bytes_read ? count : bytes_read / size;
- }
- ===================================================================
- RCS file: /net/acae127/home/bammi/etc/src/master/atari/libg++/iosrc/iofsetpos.c,v
- retrieving revision 1.1.1.1
- diff -c -r1.1.1.1 iofsetpos.c
- *** 1.1.1.1 1993/11/27 22:01:25
- --- iofsetpos.c 1994/02/01 22:32:04
- ***************
- *** 30,36 ****
- _IO_FILE* fp;
- const _IO_fpos_t *posp;
- {
- - _IO_fpos_t pos;
- COERCE_FILE(fp);
- if (_IO_seekpos(fp, *posp, 0) == _IO_pos_BAD)
- {
- --- 30,35 ----
- ===================================================================
- RCS file: /net/acae127/home/bammi/etc/src/master/atari/libg++/iosrc/iofwrite.c,v
- retrieving revision 1.1.1.1
- diff -c -r1.1.1.1 iofwrite.c
- *** 1.1.1.1 1993/11/27 22:01:25
- --- iofwrite.c 1994/02/01 22:32:04
- ***************
- *** 26,32 ****
-
- _IO_size_t
- _IO_fwrite(buf, size, count, fp)
- ! const char* buf;
- _IO_size_t size;
- _IO_size_t count;
- _IO_FILE *fp;
- --- 26,32 ----
-
- _IO_size_t
- _IO_fwrite(buf, size, count, fp)
- ! const void* buf;
- _IO_size_t size;
- _IO_size_t count;
- _IO_FILE *fp;
- ***************
- *** 34,40 ****
- _IO_size_t request = size*count;
- _IO_size_t written;
- COERCE_FILE(fp);
- ! written = _IO_sputn(fp, buf, request);
- if (written == request)
- return count;
- else
- --- 34,44 ----
- _IO_size_t request = size*count;
- _IO_size_t written;
- COERCE_FILE(fp);
- ! if (request == 0)
- ! return 0;
- ! written = _IO_sputn(fp, (const char *)buf, request);
- ! /* Many traditional implementations return 0 if size==0 && count > 0,
- ! but ANSI seems to require us to return count in this case. */
- if (written == request)
- return count;
- else
- ===================================================================
- RCS file: /net/acae127/home/bammi/etc/src/master/atari/libg++/iosrc/iopopen.c,v
- retrieving revision 1.1.1.1
- diff -c -r1.1.1.1 iopopen.c
- *** 1.1.1.1 1993/11/27 22:01:26
- --- iopopen.c 1993/12/07 22:11:21
- ***************
- *** 29,34 ****
- --- 29,42 ----
- #if _IO_HAVE_SYS_WAIT
- #include <signal.h>
- #include <unistd.h>
- + #ifdef __STDC__
- + /* This is now provided by gcc's fixproto. */
- + #include <stdlib.h>
- + #endif
- + #include <errno.h>
- + #ifndef errno
- + extern int errno;
- + #endif
- #include <sys/wait.h>
-
- #ifndef _IO_fork
- ***************
- *** 48,53 ****
- --- 56,65 ----
- extern int _IO_dup2();
- #endif
-
- + #ifndef _IO_waitpid
- + #define _IO_waitpid waitpid
- + #endif
- +
- #ifndef _IO_execl
- #define _IO_execl execl
- #endif
- ***************
- *** 55,72 ****
- #define _IO__exit _exit
- #endif
-
- - #ifdef TODO
- - /* Ditto for signal, sigxxxmask, wait etc */
- - #endif
- -
- struct _IO_proc_file
- {
- struct _IO_FILE_plus _file;
- /* Following fields must match those in class procbuf (procbuf.h) */
- _IO_pid_t _pid;
- };
- typedef struct _IO_proc_file _IO_proc_file;
-
- _IO_FILE *
- _IO_proc_open(fp, command, mode)
- _IO_FILE* fp;
- --- 67,83 ----
- #define _IO__exit _exit
- #endif
-
- struct _IO_proc_file
- {
- struct _IO_FILE_plus _file;
- /* Following fields must match those in class procbuf (procbuf.h) */
- _IO_pid_t _pid;
- + struct _IO_proc_file *_next;
- };
- typedef struct _IO_proc_file _IO_proc_file;
-
- + static struct _IO_proc_file *proc_file_chain = NULL;
- +
- _IO_FILE *
- _IO_proc_open(fp, command, mode)
- _IO_FILE* fp;
- ***************
- *** 104,109 ****
- --- 115,129 ----
- _IO_dup2(child_end, child_std_end);
- _IO_close(child_end);
- }
- + /* Posix.2: "popen() shall ensure that any streams from previous
- + popen() calls that remain open in the parent process are closed
- + in the new child process." */
- + while (proc_file_chain)
- + {
- + _IO_close (_IO_fileno ((_IO_FILE *) proc_file_chain));
- + proc_file_chain = proc_file_chain->_next;
- + }
- +
- _IO_execl("/bin/sh", "sh", "-c", command, NULL);
- _IO__exit(127);
- }
- ***************
- *** 114,119 ****
- --- 134,144 ----
- return NULL;
- }
- _IO_fileno(fp) = parent_end;
- +
- + /* Link into proc_file_chain. */
- + ((_IO_proc_file*)fp)->_next = proc_file_chain;
- + proc_file_chain = (_IO_proc_file*)fp;
- +
- fp->_IO_file_flags
- = read_or_write | (fp->_IO_file_flags & ~(_IO_NO_READS|_IO_NO_WRITES));
- return fp;
- ***************
- *** 129,139 ****
- {
- _IO_proc_file *fpx = (_IO_proc_file*)malloc(sizeof(_IO_proc_file));
- _IO_FILE *fp = (_IO_FILE*)fpx;
- _IO_init(fp, 0);
- fp->_jumps = &_IO_proc_jumps;
- _IO_file_init(fp);
- - if (fp == NULL)
- - return NULL;
- ((struct _IO_FILE_plus*)fp)->_vtable = NULL;
- if (_IO_proc_open (fp, command, mode) != NULL)
- return fp;
- --- 154,164 ----
- {
- _IO_proc_file *fpx = (_IO_proc_file*)malloc(sizeof(_IO_proc_file));
- _IO_FILE *fp = (_IO_FILE*)fpx;
- + if (fp == NULL)
- + return NULL;
- _IO_init(fp, 0);
- fp->_jumps = &_IO_proc_jumps;
- _IO_file_init(fp);
- ((struct _IO_FILE_plus*)fp)->_vtable = NULL;
- if (_IO_proc_open (fp, command, mode) != NULL)
- return fp;
- ***************
- *** 148,192 ****
- /* This is not name-space clean. FIXME! */
- #if _IO_HAVE_SYS_WAIT
- int wstatus;
- _IO_pid_t wait_pid;
- int status = _IO_close(_IO_fileno(fp));
- ! #if defined(SIG_BLOCK) && defined(SIG_SETMASK)
- ! sigset_t set, oset;
- ! #endif
- if (status < 0)
- return status;
- ! #if defined(SIG_BLOCK) && defined(SIG_SETMASK)
- ! sigemptyset (&set);
- ! sigaddset (&set, SIGINT);
- ! sigaddset (&set, SIGQUIT);
- ! sigaddset (&set, SIGHUP);
- ! sigprocmask (SIG_BLOCK, &set, &oset);
- ! #else
- ! #ifdef USE_SIGMASK
- ! int mask = sigblock(sigmask(SIGINT) | sigmask(SIGQUIT) | sigmask(SIGHUP));
- ! #else
- ! typedef void (*void_func)(int);
- ! void_func intsave = (void_func)signal(SIGINT, SIG_IGN);
- ! void_func quitsave = (void_func)signal(SIGQUIT, SIG_IGN);
- ! void_func hupsave = (void_func)signal(SIGHUP, SIG_IGN);
- ! #endif
- ! #endif
- ! while ((wait_pid = wait(&wstatus)) != ((_IO_proc_file*)fp)->_pid
- ! && wait_pid != -1) { }
- ! #if defined(SIG_BLOCK) && defined(SIG_SETMASK)
- ! sigprocmask (SIG_SETMASK, &oset, (sigset_t *)NULL);
- ! #else
- ! #ifdef USE_SIGMASK
- ! (void) sigsetmask(mask);
- ! #else
- ! signal(SIGINT, intsave);
- ! signal(SIGQUIT, quitsave);
- ! signal(SIGHUP, hupsave);
- ! #endif
- ! #endif
- if (wait_pid == -1)
- return -1;
- ! return 0;
- #else /* !_IO_HAVE_SYS_WAIT */
- return -1;
- #endif
- --- 173,205 ----
- /* This is not name-space clean. FIXME! */
- #if _IO_HAVE_SYS_WAIT
- int wstatus;
- + _IO_proc_file **ptr = &proc_file_chain;
- _IO_pid_t wait_pid;
- int status = _IO_close(_IO_fileno(fp));
- !
- ! /* Unlink from proc_file_chain. */
- ! for ( ; *ptr != NULL; ptr = &(*ptr)->_next)
- ! {
- ! if (*ptr == (_IO_proc_file*)fp)
- ! {
- ! *ptr = (*ptr)->_next;
- ! break;
- ! }
- ! }
- !
- if (status < 0)
- return status;
- ! /* POSIX.2 Rationale: "Some historical implementations either block
- ! or ignore the signals SIGINT, SIGQUIT, and SIGHUP while waiting
- ! for the child process to terminate. Since this behavior is not
- ! described in POSIX.2, such implementations are not conforming." */
- ! do
- ! {
- ! wait_pid = _IO_waitpid (((_IO_proc_file*)fp)->_pid, &wstatus, 0);
- ! } while (wait_pid == -1 && errno == EINTR);
- if (wait_pid == -1)
- return -1;
- ! return wstatus;
- #else /* !_IO_HAVE_SYS_WAIT */
- return -1;
- #endif
- ===================================================================
- RCS file: /net/acae127/home/bammi/etc/src/master/atari/libg++/iosrc/iostream.cc,v
- retrieving revision 1.1.1.1
- diff -c -r1.1.1.1 iostream.cc
- *** 1.1.1.1 1993/11/27 22:01:27
- --- iostream.cc 1993/12/07 22:11:21
- ***************
- *** 32,37 ****
- --- 32,38 ----
- #include "libioP.h"
- #include <stdio.h> /* Needed for sprintf */
- #include <ctype.h>
- + #include <string.h>
- #include <limits.h>
- #include "floatio.h"
-
- ===================================================================
- RCS file: /net/acae127/home/bammi/etc/src/master/atari/libg++/iosrc/iovfprintf.c,v
- retrieving revision 1.1.1.1
- diff -c -r1.1.1.1 iovfprintf.c
- *** 1.1.1.1 1993/11/27 22:01:28
- --- iovfprintf.c 1994/02/01 22:32:17
- ***************
- *** 69,120 ****
- /* end of configuration stuff */
-
-
- - #ifdef TODO
- /*
- ! * Helper class and function for `fprintf to unbuffered': creates a
- ! * temporary buffer. We only work on write-only files; this avoids
- ! * worries about ungetc buffers and so forth.
- ! */
-
- ! class help_streambuf : public backupbuf {
- ! public:
- ! char *buffer;
- ! int buf_size;
- ! streambuf *sb;
- ! help_streambuf(streambuf *sbuf, char *buf, int n) {
- ! sb = sbuf; buffer = buf; buf_size = n;
- ! setp(buffer, buffer+buf_size); }
- ! ~help_streambuf();
- ! virtual int overflow(int c = EOF);
- };
-
- ! int help_streambuf::overflow(int c)
- ! {
- ! int used = pptr() - pbase();
- ! if (used) {
- ! sb->sputn(pbase(), used);
- ! pbump(-used);
- ! }
- ! if (c == EOF || buf_size == 0)
- ! return sb->overflow(c);
- ! return sputc(c);
- ! }
- ! help_streambuf::~help_streambuf()
- {
- ! int used = pptr() - pbase();
- ! if (used) {
- ! sb->sputn(pbase(), used);
- ! pbump(-used);
- }
- }
-
- ! int help_vform(streambuf *sb, char const *fmt0, va_list ap)
- {
- ! char buf[_IO_BUFSIZ];
- ! help_streambuf helper(sb, buf, _IO_BUFSIZ);
- ! return helper.vform(fmt0, ap);
- }
- - #endif
-
- #ifdef FLOATING_POINT
-
- --- 69,147 ----
- /* end of configuration stuff */
-
-
- /*
- ! * Helper "class" for `fprintf to unbuffered': creates a
- ! * temporary buffer. */
-
- ! struct helper_file
- ! {
- ! struct _IO_FILE_plus _f;
- ! _IO_FILE *_put_stream;
- };
-
- ! static int
- ! _IO_helper_overflow (fp, c)
- ! _IO_FILE *fp;
- ! int c;
- {
- ! _IO_FILE *target = ((struct helper_file*)fp)->_put_stream;
- ! int used = fp->_IO_write_ptr - fp->_IO_write_base;
- ! if (used)
- ! {
- ! _IO_sputn(target, fp->_IO_write_base, used);
- ! fp->_IO_write_ptr -= used;
- }
- + return _IO_putc (c, fp);
- }
-
- ! static struct _IO_jump_t _IO_helper_jumps = {
- ! _IO_helper_overflow,
- ! _IO_default_underflow,
- ! _IO_default_xsputn,
- ! _IO_default_xsgetn,
- ! _IO_default_read,
- ! _IO_default_write,
- ! _IO_default_doallocate,
- ! _IO_default_pbackfail,
- ! _IO_default_setbuf,
- ! _IO_default_sync,
- ! _IO_default_finish,
- ! _IO_default_close,
- ! _IO_default_stat,
- ! _IO_default_seek,
- ! _IO_default_seekoff,
- ! _IO_default_seekpos,
- ! };
- !
- ! static int
- ! helper_vfprintf(fp, fmt0, ap)
- ! register _IO_FILE* fp;
- ! char const *fmt0;
- ! _IO_va_list ap;
- {
- ! char buf[_IO_BUFSIZ];
- ! struct helper_file helper;
- ! register _IO_FILE *hp = (_IO_FILE*)&helper;
- ! int result, to_flush;
- !
- ! /* initialize helper */
- ! helper._put_stream = fp;
- ! hp->_IO_write_base = buf;
- ! hp->_IO_write_ptr = buf;
- ! hp->_IO_write_end = buf+_IO_BUFSIZ;
- ! hp->_jumps = &_IO_helper_jumps;
- !
- ! /* Now print to helper instead. */
- ! result = _IO_vfprintf(hp, fmt0, ap);
- !
- ! /* Now flush anything from the helper to the fp. */
- ! if ((to_flush = hp->_IO_write_ptr - hp->_IO_write_base) > 0)
- ! {
- ! if (_IO_sputn(fp, hp->_IO_write_base, to_flush) != to_flush)
- ! return EOF;
- ! }
- ! return result;
- }
-
- #ifdef FLOATING_POINT
-
- ***************
- *** 204,214 ****
- flags&SHORTINT ? (unsigned long)(unsigned short)va_arg(ap, int) : \
- (unsigned long)va_arg(ap, unsigned int))
-
- ! #ifdef TODO
- ! /* optimise cerr (and other unbuffered Unix files) */
- ! if (unbuffered())
- ! return help_vform(this, fmt0, ap);
- ! #endif
-
- fmt = fmt0;
- ret = 0;
- --- 231,239 ----
- flags&SHORTINT ? (unsigned long)(unsigned short)va_arg(ap, int) : \
- (unsigned long)va_arg(ap, unsigned int))
-
- ! /* optimise stderr (and other unbuffered Unix files) */
- ! if (fp->_IO_file_flags & _IO_UNBUFFERED)
- ! return helper_vfprintf(fp, fmt0, ap);
-
- fmt = fmt0;
- ret = 0;
- ===================================================================
- RCS file: /net/acae127/home/bammi/etc/src/master/atari/libg++/iosrc/iovfscanf.c,v
- retrieving revision 1.1.1.1
- diff -c -r1.1.1.1 iovfscanf.c
- *** 1.1.1.1 1993/11/27 22:01:28
- --- iovfscanf.c 1994/02/01 22:32:18
- ***************
- *** 40,46 ****
- */
-
- /* Extensively hacked for GNU iostream by Per Bothner 1991, 1992, 1993.
- ! /* Changes copyright Per Bothner 1992, 1993. */
-
- #if defined(LIBC_SCCS) && !defined(lint)
- static char sccsid[] = "%W% (Berkeley) %G%";
- --- 40,46 ----
- */
-
- /* Extensively hacked for GNU iostream by Per Bothner 1991, 1992, 1993.
- ! Changes copyright Free Software Foundation 1992, 1993. */
-
- #if defined(LIBC_SCCS) && !defined(lint)
- static char sccsid[] = "%W% (Berkeley) %G%";
- ***************
- *** 102,108 ****
- #define u_long unsigned long
-
- extern u_long strtoul _PARAMS((const char*, char**, int));
- ! extern u_long strtol _PARAMS((const char*, char**, int));
- static const u_char *__sccl _PARAMS((char *tab, const u_char *fmt));
- #ifndef USE_DTOA
- extern double atof();
- --- 102,108 ----
- #define u_long unsigned long
-
- extern u_long strtoul _PARAMS((const char*, char**, int));
- ! extern long strtol _PARAMS((const char*, char**, int));
- static const u_char *__sccl _PARAMS((char *tab, const u_char *fmt));
- #ifndef USE_DTOA
- extern double atof();
- ***************
- *** 149,156 ****
- if (isspace(c)) {
- for (;;) {
- c = _IO_getc(fp);
- ! if (c == EOF)
- ! goto eof_failure;
- if (!isspace(c)) {
- _IO_ungetc (c, fp);
- break;
- --- 149,158 ----
- if (isspace(c)) {
- for (;;) {
- c = _IO_getc(fp);
- ! if (c == EOF) {
- ! seen_eof++;
- ! break;
- ! }
- if (!isspace(c)) {
- _IO_ungetc (c, fp);
- break;
- ===================================================================
- RCS file: /net/acae127/home/bammi/etc/src/master/atari/libg++/iosrc/iovsscanf.c,v
- retrieving revision 1.1.1.1
- diff -c -r1.1.1.1 iovsscanf.c
- *** 1.1.1.1 1993/11/27 22:01:28
- --- iovsscanf.c 1994/02/01 22:32:18
- ***************
- *** 34,39 ****
- _IO_strfile sf;
- _IO_init((_IO_FILE*)&sf, 0);
- ((_IO_FILE*)&sf)->_jumps = &_IO_str_jumps;
- ! _IO_str_init_static ((_IO_FILE*)&sf, (char*)string, -1, NULL);
- return _IO_vfscanf((_IO_FILE*)&sf, format, args, NULL);
- }
- --- 34,39 ----
- _IO_strfile sf;
- _IO_init((_IO_FILE*)&sf, 0);
- ((_IO_FILE*)&sf)->_jumps = &_IO_str_jumps;
- ! _IO_str_init_static ((_IO_FILE*)&sf, (char*)string, 0, NULL);
- return _IO_vfscanf((_IO_FILE*)&sf, format, args, NULL);
- }
- ===================================================================
- RCS file: /net/acae127/home/bammi/etc/src/master/atari/libg++/iosrc/pfstream.cc,v
- retrieving revision 1.1.1.1
- diff -c -r1.1.1.1 pfstream.cc
- *** 1.1.1.1 1993/11/27 22:01:29
- --- pfstream.cc 1993/12/07 22:11:43
- ***************
- *** 60,66 ****
- command[p-name] = '\0';
-
- procbuf *pbuf = new procbuf();
- - int(pbuf);
- if (pbuf->open(command, mode))
- set(ios::badbit);
- #ifndef __GNUC__
- --- 60,65 ----
- ===================================================================
- RCS file: /net/acae127/home/bammi/etc/src/master/atari/libg++/iosrc/sbscan.cc,v
- retrieving revision 1.1.1.1
- diff -c -r1.1.1.1 sbscan.cc
- *** 1.1.1.1 1993/11/27 22:01:30
- --- sbscan.cc 1994/02/01 22:32:35
- ***************
- *** 27,38 ****
- #include "streambuf.h"
- #include <stdarg.h>
-
- ! int streambuf::vscan(char const *fmt0, _IO_va_list ap, ios* stream = NULL)
- {
- int errcode = 0;
- ! return _IO_vfscanf(this, fmt0, ap, &errcode);
- if (stream)
- stream->setstate((ios::iostate)errcode);
- }
- int streambuf::scan(char const *format ...)
- {
- --- 27,39 ----
- #include "streambuf.h"
- #include <stdarg.h>
-
- ! int streambuf::vscan(char const *fmt0, _IO_va_list ap, ios* stream /* = NULL*/)
- {
- int errcode = 0;
- ! int count = _IO_vfscanf(this, fmt0, ap, &errcode);
- if (stream)
- stream->setstate((ios::iostate)errcode);
- + return count;
- }
- int streambuf::scan(char const *format ...)
- {
- ===================================================================
- RCS file: /net/acae127/home/bammi/etc/src/master/atari/libg++/iosrc/stdfiles.c,v
- retrieving revision 1.1.1.1
- diff -c -r1.1.1.1 stdfiles.c
- *** 1.1.1.1 1993/11/27 22:01:30
- --- stdfiles.c 1993/12/07 22:11:44
- ***************
- *** 31,37 ****
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, CHAIN, &_IO_file_jumps, FD}
-
- #define DEF_STDFILE(NAME, FD, CHAIN, FLAGS) \
- ! struct _IO_FILE_plus NAME = {FILEBUF_LITERAL(CHAIN, FLAGS, FD), 0};
-
- DEF_STDFILE(_IO_stdin_, 0, 0, _IO_NO_WRITES);
- DEF_STDFILE(_IO_stdout_, 1, &_IO_stdin_._file, _IO_NO_READS);
- --- 31,37 ----
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, CHAIN, &_IO_file_jumps, FD}
-
- #define DEF_STDFILE(NAME, FD, CHAIN, FLAGS) \
- ! struct _IO_FILE_plus NAME = {FILEBUF_LITERAL(CHAIN, FLAGS, FD), 0}
-
- DEF_STDFILE(_IO_stdin_, 0, 0, _IO_NO_WRITES);
- DEF_STDFILE(_IO_stdout_, 1, &_IO_stdin_._file, _IO_NO_READS);
- ===================================================================
- RCS file: /net/acae127/home/bammi/etc/src/master/atari/libg++/iosrc/stdstreams.cc,v
- retrieving revision 1.1.1.1
- diff -c -r1.1.1.1 stdstreams.cc
- *** 1.1.1.1 1993/11/27 22:01:31
- --- stdstreams.cc 1993/12/07 22:11:44
- ***************
- *** 39,45 ****
- #define USE_FILEBUF
- #endif
-
- ! #ifdef NAMES_HAVE_UNDERSCORE
- #define UNDERSCORE "_"
- #else
- #define UNDERSCORE ""
- --- 39,45 ----
- #define USE_FILEBUF
- #endif
-
- ! #if _G_NAMES_HAVE_UNDERSCORE
- #define UNDERSCORE "_"
- #else
- #define UNDERSCORE ""
- ***************
- *** 116,138 ****
- (streambuf*)&SBUF, TIE, 0, ios::dont_close|ios::skipws|EXTRA_FLAGS, ' ',0,0,6
-
- #ifdef __GNUC__
- ! #define OSTREAM_DEF(TYPE, NAME, SBUF, TIE, EXTRA_FLAGS) \
- ! TYPE NAME = { {&NAME.base}, {STD_STR(SBUF, TIE, EXTRA_FLAGS) }};
- ! #define ISTREAM_DEF(TYPE, NAME, SBUF, TIE, EXTRA_FLAGS) \
- ! TYPE NAME = { {&NAME.base}, {STD_STR(SBUF, TIE, EXTRA_FLAGS) }};
- ! #else
- ! #define OSTREAM_DEF(TYPE, NAME, SBUF, TIE, EXTRA_FLAGS) \
- ! TYPE NAME = { {0, &NAME.base}, {STD_STR(SBUF, TIE, EXTRA_FLAGS) }};
- ! #define ISTREAM_DEF(TYPE, NAME, SBUF, TIE, EXTRA_FLAGS) \
- ! TYPE NAME = { {0, 0, &NAME.base}, {STD_STR(SBUF, TIE, EXTRA_FLAGS) }};
- #endif
-
- ! OSTREAM_DEF(_fake_ostream, cout, COUT_SBUF, NULL, 0)
- ! OSTREAM_DEF(_fake_ostream, cerr, CERR_SBUF, (ostream*)&cout, ios::unitbuf)
- ! ISTREAM_DEF(_fake_istream, cin, CIN_SBUF, (ostream*)&cout, 0)
-
- /* Only for (partial) compatibility with AT&T's library. */
- ! OSTREAM_DEF(_fake_ostream, clog, CERR_SBUF, (ostream*)&cout, 0)
-
- // Switches between using __std_filebuf_{0,1,2} and
- // __std{in,out,err}_stdiobuf for standard streams. This is
- --- 116,138 ----
- (streambuf*)&SBUF, TIE, 0, ios::dont_close|ios::skipws|EXTRA_FLAGS, ' ',0,0,6
-
- #ifdef __GNUC__
- ! #define OSTREAM_DEF(NAME, SBUF, TIE, EXTRA_FLAGS) \
- ! _fake_ostream NAME = { {&NAME.base}, {STD_STR(SBUF, TIE, EXTRA_FLAGS) }};
- ! #define ISTREAM_DEF(NAME, SBUF, TIE, EXTRA_FLAGS) \
- ! _fake_istream NAME = { {&NAME.base}, {STD_STR(SBUF, TIE, EXTRA_FLAGS) }};
- ! #else
- ! #define OSTREAM_DEF(NAME, SBUF, TIE, EXTRA_FLAGS) \
- ! _fake_ostream NAME = { {0, &NAME.base}, {STD_STR(SBUF, TIE, EXTRA_FLAGS) }};
- ! #define ISTREAM_DEF(NAME, SBUF, TIE, EXTRA_FLAGS) \
- ! _fake_ostream NAME = {{0, 0, &NAME.base}, {STD_STR(SBUF, TIE, EXTRA_FLAGS)}};
- #endif
-
- ! OSTREAM_DEF(cout, COUT_SBUF, NULL, 0)
- ! OSTREAM_DEF(cerr, CERR_SBUF,(ostream*)&cout, ios::unitbuf)
- ! ISTREAM_DEF(cin, CIN_SBUF, (ostream*)&cout, 0)
-
- /* Only for (partial) compatibility with AT&T's library. */
- ! OSTREAM_DEF(clog, CERR_SBUF, (ostream*)&cout, 0)
-
- // Switches between using __std_filebuf_{0,1,2} and
- // __std{in,out,err}_stdiobuf for standard streams. This is
- ===================================================================
- RCS file: /net/acae127/home/bammi/etc/src/master/atari/libg++/iosrc/streambuf.cc,v
- retrieving revision 1.1.1.1
- diff -c -r1.1.1.1 streambuf.cc
- *** 1.1.1.1 1993/11/27 22:01:31
- --- streambuf.cc 1993/12/07 22:11:44
- ***************
- *** 125,131 ****
- }
-
- void streambuf::setb(char* b, char* eb, int a)
- ! { return _IO_setb(this, b, eb, a); }
-
- int streambuf::doallocate() { return _IO_default_doallocate(this); }
-
- --- 125,131 ----
- }
-
- void streambuf::setb(char* b, char* eb, int a)
- ! { _IO_setb(this, b, eb, a); }
-
- int streambuf::doallocate() { return _IO_default_doallocate(this); }
-
- ***************
- *** 261,267 ****
- int streambuf::flush_all() { return _IO_flush_all (); }
-
- void streambuf::flush_all_linebuffered()
- ! { return _IO_flush_all_linebuffered(); }
-
- int streambuf::sys_stat(void *)
- {
- --- 261,267 ----
- int streambuf::flush_all() { return _IO_flush_all (); }
-
- void streambuf::flush_all_linebuffered()
- ! { _IO_flush_all_linebuffered(); }
-
- int streambuf::sys_stat(void *)
- {
- ===================================================================
- RCS file: /net/acae127/home/bammi/etc/src/master/atari/libg++/iosrc/strops.c,v
- retrieving revision 1.1.1.1
- diff -c -r1.1.1.1 strops.c
- *** 1.1.1.1 1993/11/27 22:01:31
- --- strops.c 1993/12/07 22:11:58
- ***************
- *** 24,29 ****
- --- 24,30 ----
-
- #include "strfile.h"
- #include "libioP.h"
- + #include <string.h>
-
- #define LEN(fp) (((_IO_strfile*)(fp))->_s._len)
-
- ===================================================================
- RCS file: /net/acae127/home/bammi/etc/src/master/atari/libg++/iosrc/strstream.cc,v
- retrieving revision 1.1.1.1
- diff -c -r1.1.1.1 strstream.cc
- *** 1.1.1.1 1993/11/27 22:01:32
- --- strstream.cc 1993/12/07 22:11:59
- ***************
- *** 28,34 ****
- #pragma implementation
- #endif
- #include "iostreamP.h"
- ! #include <strstream.h>
-
- static void* default_alloc(_IO_size_t size)
- {
- --- 28,35 ----
- #pragma implementation
- #endif
- #include "iostreamP.h"
- ! #include "strstream.h"
- ! #include <string.h>
-
- static void* default_alloc(_IO_size_t size)
- {
- ===================================================================
- RCS file: /net/acae127/home/bammi/etc/src/master/atari/libg++/iotests/makefile.32,v
- retrieving revision 1.2
- diff -c -r1.2 makefile.32
- *** 1.2 1993/11/29 22:12:53
- --- makefile.32 1994/02/01 23:07:20
- ***************
- *** 38,44 ****
- LDFLAGS = -v -lpml -s -lg++
-
- TEST= hounddog.ttp putbackdog.ttp tFile.ttp tfformat.ttp tiformat.ttp \
- ! tiomanip.ttp
-
- OBJS = $(TEST:.ttp=.o)
- # the stuff to make
- --- 38,44 ----
- LDFLAGS = -v -lpml -s -lg++
-
- TEST= hounddog.ttp putbackdog.ttp tFile.ttp tfformat.ttp tiformat.ttp \
- ! tiomanip.ttp tiomisc.ttp
-
- OBJS = $(TEST:.ttp=.o)
- # the stuff to make
- ***************
- *** 48,54 ****
- obj: $(OBJS)
-
- # g++ files should have extension .cc
- ! # generated test files will habe .ttp extn
-
- .SUFFIXES: .ttp .cc
- .cc.o:
- --- 48,54 ----
- obj: $(OBJS)
-
- # g++ files should have extension .cc
- ! # generated test files will have .ttp extn
-
- .SUFFIXES: .ttp .cc
- .cc.o:
- ***************
- *** 72,77 ****
- tfformat.ttp : tfformat.o
- tiformat.ttp : tiformat.o
- tiomanip.ttp : tiomanip.o
-
- -
- -
- --- 72,76 ----
- tfformat.ttp : tfformat.o
- tiformat.ttp : tiformat.o
- tiomanip.ttp : tiomanip.o
- + tiomisc.ttp: tiomisc.o
-
- ===================================================================
- RCS file: /net/acae127/home/bammi/etc/src/master/atari/libg++/iotests/run32.g,v
- retrieving revision 1.1
- diff -c -r1.1 run32.g
- *** 1.1 1993/11/29 22:12:55
- --- run32.g 1994/02/01 23:07:29
- ***************
- *** 1,22 ****
- ! ./tFile < ./tFile.inp > tFile.out 2>&1
- ! diff -c tFile.out ./tFile.exp
- ! ./tFile -b0 < ./tFile.inp > tFile-buf0.out 2>&1
- ! diff -c tFile-buf0.out ./tFile.exp
- ! ./tFile -b3 < ./tFile.inp > tFile-buf3.out 2>&1
- ! diff -c tFile-buf3.out ./tFile.exp
- ! ./hounddog <./hounddog.inp > hounddog.out 2>&1
- ! diff -c hounddog.out ./hounddog.exp
- ! ./hounddog -b0 <./hounddog.inp > hound-b0.out 2>&1
- ! diff -c hound-b0.out ./hounddog.exp
- ! ./hounddog -b2 <./hounddog.inp > hound-b2.out 2>&1
- ! diff -c hound-b2.out ./hounddog.exp
- ! ./putbackdog <./hounddog.inp > putback.out 2>&1
- ! diff -c putback.out ./hounddog.exp
- ! ./putbackdog -b0 <./hounddog.inp > putback-b0.out 2>&1
- ! diff -c putback-b0.out ./hounddog.exp
- ! ./putbackdog -b2 <./hounddog.inp > putback-b2.out 2>&1
- ! diff -c putback-b2.out ./hounddog.exp
- ! ./tiomanip >tiomanip.out 2>&1
- ! diff -c tiomanip.out ./tiomanip.exp
- ! ./tiformat
- ! ./tfformat
- --- 1,24 ----
- ! .\tFile < .\tFile.inp > tFile.out 2>&1
- ! diff -c tFile.out .\tFile.exp
- ! .\tFile -b0 < .\tFile.inp > tFile-buf0.out 2>&1
- ! diff -c tFile-buf0.out .\tFile.exp
- ! .\tFile -b3 < .\tFile.inp > tFile-buf3.out 2>&1
- ! diff -c tFile-buf3.out .\tFile.exp
- ! .\hounddog <.\hounddog.inp > hounddog.out 2>&1
- ! diff -c hounddog.out .\hounddog.exp
- ! .\hounddog -b0 <.\hounddog.inp > hound-b0.out 2>&1
- ! diff -c hound-b0.out .\hounddog.exp
- ! .\hounddog -b2 <.\hounddog.inp > hound-b2.out 2>&1
- ! diff -c hound-b2.out .\hounddog.exp
- ! .\putbackdog <.\hounddog.inp > putback.out 2>&1
- ! diff -c putback.out .\hounddog.exp
- ! .\putbackdog -b0 <.\hounddog.inp > putback-b0.out 2>&1
- ! diff -c putback-b0.out .\hounddog.exp
- ! .\putbackdog -b2 <.\hounddog.inp > putback-b2.out 2>&1
- ! diff -c putback-b2.out .\hounddog.exp
- ! .\tiomanip >tiomanip.out 2>&1
- ! diff -c tiomanip.out .\tiomanip.exp
- ! .\tiformat
- ! .\tfformat
- ! .\tiomisc >tiomisc.out 2>&1
- ! diff -c tiomisc.out .\tiomisc.exp
- ===================================================================
- RCS file: /net/acae127/home/bammi/etc/src/master/atari/libg++/libsrc/xfix.cc,v
- retrieving revision 1.1.1.1
- diff -c -r1.1.1.1 xfix.cc
- *** 1.1.1.1 1993/11/27 22:01:44
- --- xfix.cc 1994/02/01 22:28:26
- ***************
- *** 455,461 ****
-
- void Fix::printon(ostream& s, int width) const
- {
- - char format[20];
- double val = value(*this);
- int old_precision = s.precision(width-3);
- long old_flags = s.setf(ios::fixed, ios::fixed|ios::scientific);
- --- 455,460 ----
- ===================================================================
- RCS file: /net/acae127/home/bammi/etc/src/master/atari/libg++/libsrc/xinteger.cc,v
- retrieving revision 1.1.1.1
- diff -c -r1.1.1.1 xinteger.cc
- *** 1.1.1.1 1993/11/27 22:01:45
- --- xinteger.cc 1994/02/01 22:28:33
- ***************
- *** 2138,2144 ****
- else
- {
- char* p = fmt;
- - int gap = s - p;
- for (char* t = s; *t != 0; ++t, ++p) *p = *t;
- while (w++ < width) *p++ = fillchar;
- *p = 0;
- --- 2138,2143 ----
-